package com.yan;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
	
	/**
	 * 启动方式，直接加载ApplicationContext.xml启动，用于实际生产环境，在生产环境中会加载数据库等一些配置，这些配置可以配置到ApplicationContext.xml
	 * @param args
	 */
	public static void main(String[] args) {
		ClassPathXmlApplicationContext  context = new ClassPathXmlApplicationContext(
				new String[]{"classpath:spring/ApplicationContext.xml"});
		context.start();
		System.out.println("spring 启动");
		synchronized (Main.class) { 
            while (true) { 
                try { 
                	Main.class.wait();
                } catch (Throwable e) { 
              }
            } 
        }
	}
}

